package com.luaj.elasticsearch.service.impl;

import com.luaj.elasticsearch.mapper.CategoryMapper;
import com.luaj.elasticsearch.pojo.Category;
import com.luaj.elasticsearch.service.CategoryService;
import com.luaj.elasticsearch.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 卢安杰
 * @date 2020-11-20 20:06
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public int countAllCategory() {

        return categoryMapper.selectCount(null);
    }

    @Override
    public List<Category> selectAll() {
        return categoryMapper.selectAll();
    }

    @Override
    public void create(Category categoryModel) {
        categoryMapper.insertSelective(categoryModel);
    }
}
